<?php

/**
 * EmpresaIngreso form base class.
 *
 * @method EmpresaIngreso getObject() Returns the current form's model object
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseEmpresaIngresoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                    => new sfWidgetFormInputHidden(),
      'renta_id'              => new sfWidgetFormInputText(),
      'division_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Division'), 'add_empty' => false)),
      'concepto_cf_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => false)),
      'empresa_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => false)),
      'agendado_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Agendado'), 'add_empty' => true)),
      'camioneta_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'add_empty' => true)),
      'operador_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'), 'add_empty' => true)),
      'operadores_egresos_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('OperadoresEgresos'), 'add_empty' => true)),
      'cliente_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cliente'), 'add_empty' => true)),
      'servicio_tipo_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ServicioTipo'), 'add_empty' => false)),
      'pago_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Pago'), 'add_empty' => false)),
      'banco_id'              => new sfWidgetFormInputText(),
      'numero_cheque'         => new sfWidgetFormInputText(),
      'cantidad'              => new sfWidgetFormInputText(),
      'descripcion'           => new sfWidgetFormTextarea(),
      'monto'                 => new sfWidgetFormInputText(),
      'fecha'                 => new sfWidgetFormDateTime(),
      'status'                => new sfWidgetFormInputText(),
      'created_at'            => new sfWidgetFormDateTime(),
      'updated_at'            => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'renta_id'              => new sfValidatorInteger(array('required' => false)),
      'division_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Division'), 'required' => false)),
      'concepto_cf_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'required' => false)),
      'empresa_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'required' => false)),
      'agendado_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Agendado'), 'required' => false)),
      'camioneta_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'required' => false)),
      'operador_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'), 'required' => false)),
      'operadores_egresos_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('OperadoresEgresos'), 'required' => false)),
      'cliente_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cliente'), 'required' => false)),
      'servicio_tipo_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ServicioTipo'))),
      'pago_id'               => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Pago'))),
      'banco_id'              => new sfValidatorInteger(array('required' => false)),
      'numero_cheque'         => new sfValidatorInteger(array('required' => false)),
      'cantidad'              => new sfValidatorInteger(array('required' => false)),
      'descripcion'           => new sfValidatorString(array('required' => false)),
      'monto'                 => new sfValidatorNumber(array('required' => false)),
      'fecha'                 => new sfValidatorDateTime(),
      'status'                => new sfValidatorInteger(),
      'created_at'            => new sfValidatorDateTime(),
      'updated_at'            => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('empresa_ingreso[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'EmpresaIngreso';
  }

}
